package admin

import (
	"appService/src/application/admin"
	"appService/src/application/admin/admin/adminModels"
	"appService/src/application/admin/admin/controller"
	"appService/src/application/app/appModels"
	"appService/src/application/app/authGroup"
	"appService/src/authValid/dataAuth"
	"appService/src/global/router"
)

// 返回路由切片
func GetRouterList() []*router.Router {
	return routeMap
}

// 返回数据库表 模型 切片
func GetModeBans() []interface{} {
	return []interface{}{
		new(adminModels.Branch),
		new(adminModels.Api),
		new(adminModels.Auth),
		new(adminModels.Roles),
		new(appModels.Folder),
		new(appModels.Files),
	}
}

//路由数组
var routeMap []*router.Router = []*router.Router{
	//branch------------------
	{
		Title:       "部门机构—添加",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/branch",
		Method:      router.POST,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Branch{},
		Func:        "Add",
	},
	{
		Title:       "部门机构—删除",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/branch",
		Method:      router.DELETE,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Branch{},
		Func:        "Delete",
	},
	{
		Title:       "部门机构—修改",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/branch",
		Method:      router.PUT,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Branch{},
		Func:        "Edit",
	},
	{
		Title:       "部门机构—查询",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/branch/:id",
		Method:      router.GET,
		Visit:       dataAuth.LOGIN,
		Object:      &controller.Branch{},
		Func:        "Get",
	},
	{
		Title:       "部门机构—设置默认",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/branch/:id",
		Method:      router.PUT,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Branch{},
		Func:        "SetDefault",
	},
	{
		Title:       "部门机构—列表",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/branch",
		Method:      router.GET,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Branch{},
		Func:        "List",
	},
	/*{
		Title:  "部门机构—取用户拥有",
	    AuthGroupId: authGroup.ADMIN_ID,
		Router: admin.ModelRootRouteName + "/branch/user",
		Method: router.GET,
		Visit:  apiAuth.AUTH,
		Object: &controller.Branch{},
		Func:   "UserBranchID",
	},*/
	//account------------------
	{
		Title:       "用户账号—添加",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/account",
		Method:      router.POST,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Account{},
		Func:        "Add",
	},
	{
		Title:       "用户账号—删除",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/account",
		Method:      router.DELETE,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Account{},
		Func:        "Delete",
	},
	{
		Title:       "用户账号—修改",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/account",
		Method:      router.PUT,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Account{},
		Func:        "Edit",
	},
	{
		Title:       "用户账号—修改基本资料",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/account/:id",
		Method:      router.PUT,
		Visit:       dataAuth.LOGIN,
		Object:      &controller.Account{},
		Func:        "EditUserInfo",
	},
	{
		Title:       "用户账号—修改密码",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/account/pass/:id",
		Method:      router.PUT,
		Visit:       dataAuth.LOGIN,
		Object:      &controller.Account{},
		Func:        "EditUserPassWord",
	},
	{
		Title:       "用户账号—分页列表",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/account/:page_size/:page",
		Method:      router.GET,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Account{},
		Func:        "ListPaginate",
	},
	//admin
	{
		Title:       "用户权限—添加",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/users",
		Method:      router.POST,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Users{},
		Func:        "Add",
	},
	{
		Title:       "用户权限—删除",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/users",
		Method:      router.DELETE,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Users{},
		Func:        "Delete",
	},
	{
		Title:       "用户权限—修改",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/users",
		Method:      router.PUT,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Users{},
		Func:        "Edit",
	},
	{
		Title:       "用户权限—查询用户",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/users/:id",
		Method:      router.GET,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Users{},
		Func:        "Get",
	},
	{
		Title:       "用户权限—分页列表",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/users/:page_size/:page",
		Method:      router.GET,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Users{},
		Func:        "ListPaginate",
	},
	//roles
	{
		Title:       "权限角色—添加",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/roles",
		Method:      router.POST,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Roles{},
		Func:        "Add",
	},
	{
		Title:       "权限角色—删除",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/roles",
		Method:      router.DELETE,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Roles{},
		Func:        "Delete",
	},
	{
		Title:       "权限角色—修改",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/roles",
		Method:      router.PUT,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Roles{},
		Func:        "Edit",
	},
	{
		Title:       "权限角色—列表",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/roles",
		Method:      router.GET,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Roles{},
		Func:        "List",
	},
	{
		Title:       "权限角色—分页列表",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/roles/:page_size/:page",
		Method:      router.GET,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Roles{},
		Func:        "ListPaginate",
	},
	//authGroup-----------
	{
		Title:       "权限组—取权限标识",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/auth-group/app-code/:id",
		Method:      router.GET,
		Visit:       dataAuth.AUTH,
		Object:      &controller.AuthGroup{},
		Func:        "GetAppCode",
	},
	{
		Title:       "权限组—列表",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/auth-group",
		Method:      router.GET,
		Visit:       dataAuth.AUTH,
		Object:      &controller.AuthGroup{},
		Func:        "List",
	},
	{
		Title:       "权限组—获取共享端ID",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/auth-group/share-id",
		Method:      router.GET,
		Visit:       dataAuth.AUTH,
		Object:      &controller.AuthGroup{},
		Func:        "ShareId",
	},
	//auth-------------
	{
		Title:       "菜单权限—添加",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/auth",
		Method:      router.POST,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Auth{},
		Func:        "Add",
	},
	{
		Title:       "菜单权限—删除",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/auth",
		Method:      router.DELETE,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Auth{},
		Func:        "Delete",
	},
	{
		Title:       "菜单权限—修改",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/auth",
		Method:      router.PUT,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Auth{},
		Func:        "Edit",
	},
	{
		Title:       "菜单权限—列表",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/auth",
		Method:      router.GET,
		Visit:       dataAuth.SYSTEM,
		Object:      &controller.Auth{},
		Func:        "List",
	},
	{
		Title:       "菜单权限—列表（权限）",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/auth/:id",
		Method:      router.GET,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Auth{},
		Func:        "AuthList",
	},
	//api
	{
		Title:       "数据接口—删除",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/api",
		Method:      router.DELETE,
		Visit:       dataAuth.SYSTEM,
		Object:      &controller.Api{},
		Func:        "Delete",
	},
	{
		Title:       "数据权限—修改",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/api",
		Method:      router.PUT,
		Visit:       dataAuth.SYSTEM,
		Object:      &controller.Api{},
		Func:        "Edit",
	},
	{
		Title:       "数据权限—分页列表",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/api/:page_size/:page",
		Method:      router.GET,
		Visit:       dataAuth.SYSTEM,
		Object:      &controller.Api{},
		Func:        "ListPaginate",
	},
	{
		Title:       "数据权限—列表（权限）",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/api",
		Method:      router.GET,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Api{},
		Func:        "List",
	},
	//----------文件夹-----------
	{
		Title:       "文件夹—添加",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/folder",
		Method:      router.POST,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Folder{},
		Func:        "Add",
	},
	{
		Title:       "文件夹—删除",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/folder",
		Method:      router.DELETE,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Folder{},
		Func:        "Delete",
	},
	{
		Title:       "文件夹—修改",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/folder",
		Method:      router.PUT,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Folder{},
		Func:        "Edit",
	},
	{
		Title:       "文件夹—列表",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/folder",
		Method:      router.GET,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Folder{},
		Func:        "List",
	},
	//----文件-----------------------------
	{
		Title:       "文件—上传",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/file/:folder_id",
		Method:      router.POST,
		IsSign:      2,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Files{},
		Func:        "Add",
	},
	{
		Title:       "文件—删除",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/file",
		Method:      router.DELETE,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Files{},
		Func:        "Delete",
	},
	/*
	{
		Title:       "文件-移动文件",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/file",
		Method:      router.PUT,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Files{},
		Func:        "Edit",
	},*/
	{
		Title:       "文件-列表（分页）",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      admin.ModelRootRouteName + "/file/:page_size/:page",
		Method:      router.GET,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Files{},
		Func:        "ListPaginate",
	},
}
